#include "InputSystem.h"

namespace DreamEngine
{
CInputSystem::CInputSystem(void):
m_pKeyBoard(MATH_NULL),
m_pMouse(MATH_NULL)
{
}


CInputSystem::~CInputSystem(void)
{
}

CInputSystem& CInputSystem::Instance(void)
{	
	return (*m_singleton); 
}

CInputSystem* CInputSystem::InstancePtr(void)
{ 
	return m_singleton; 
}

Error CInputSystem::ShutDown()
{
	m_pKeyBoard->ShutDown();
	m_pMouse->ShutDown();

	SAFE_DELETE(m_pKeyBoard);
	SAFE_DELETE(m_pMouse);

	return ERROR_OK;
}

Error CInputSystem::SetExclusiveMode(m_uint8 exclusiveMode)
{
	CheckEngineError(m_pKeyBoard->SetExclusiveMode(exclusiveMode));
	CheckEngineError(m_pMouse->SetExclusiveMode(exclusiveMode));

	return ERROR_OK;
}

Error CInputSystem::Update()
{
	CheckEngineError(m_pMouse->Update());
	CheckEngineError(m_pKeyBoard->Update());

	return ERROR_OK;
}

}

